/*
 * @Author: your name
 * @Date: 2021-12-29 16:56:19
 * @LastEditTime: 2021-12-30 07:55:42
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AEc
 * @FilePath: \myapp\src\utils\debounce.tsx
 */
// 函数防抖  
export function debounce(callback, time = 400) {
	let timer;
	return (...args) => {
		clearTimeout(timer)
		timer = setTimeout(() => {
			callback(...args)
		}, time)
	}
}

